home *** CD-ROM | disk | FTP | other *** search
- /* SETCBLK.C --- p. 660 */
- #include <stdio.h>
- #include <dos.h>
- #include <string.h>
- main(int argc, char **argv)
- {
- int cbrk_flag;
- if(argc < 2)
- {
- printf("Useage: %s <ON or OFF)\n", argv[0]);
- exit(0);
- }
- if((strcmp(argv[1] , "ON") == 0) ||
- (strcmp(argv[1], "on") == 0)) cbrk_flag = 1;
- else
- {
- if((strcmp(argv[1] , "OFF") == 0) ||
- (strcmp(argv[1], "off") == 0)) cbrk_flag = 0;
- else
- {
- printf("Unknown flag: %s\n", argv[1]);
- exit(0);
- }
- }
- /* Set the flag and print new value of flag */
- setcbrk(cbrk_flag);
- printf("Current value or the Control_Break checking "
- "flag = %d\n", getcbrk());
- }